<?php
class service_company{
	static public function getInfo(){
		$companyDao = new DaoCompany();
		$company = array();
		$companys = $companyDao->getAll(1);
		if(!empty($companys)){
			$company = $companys[0]; 
		}
		return $company;
	}
	static public function save($info){
		$companyDao = new DaoCompany();
		$company = self::getInfo();
		if(empty($company)){
			$companyDao->insert($info);
		}else{
			$companyDao->update("id='{$company['id']}'",$info);
		}
	}
}
?>
